package com.spa.infrastructure.enums.dict.profit;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "profitOrderDetailType", desc = "分润订单详情类型")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum OrderProfitType implements IBaseEnum {
    $1(1,"技师",1,0),
    $2(2,"门店",2,0),
    ;
    private final Integer code;

    private final String desc;

    private final Integer sort;

    private final Integer status;

    public static OrderProfitType byCode(int code){
        for (OrderProfitType value : OrderProfitType.values()){
            if (value.getCode() == code){
                return value;
            }
        }
        return null;
    }

}
